package com.itheima.day04;

import java.util.Scanner;

/**
 *数组元素求和
 */
public class Demo4 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int sum=0;
        int []arr= new int[5];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第"+(i+1)+"个元素");
            arr[i] = sc.nextInt();
        }
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}
